package com.jgsu.farm.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@NoArgsConstructor
@AllArgsConstructor
@Data
@Table(name = "inquiry")
public class Inquiry implements Serializable {

    @NonNull
    @GeneratedValue(generator = "JDBC",strategy = GenerationType.IDENTITY)
    @Id
    private Integer inquiryid;
    @NonNull
    private Integer userid;
    @NonNull
    private Integer cropid;

    private String symptom;

    private Integer image;

    private Integer video;

    private Integer spectral;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date time;

    public Inquiry(@NonNull Integer userid, @NonNull Integer cropid, String symptom, Integer image, Integer video, Integer spectral, Date time) {
        this.userid = userid;
        this.cropid = cropid;
        this.symptom = symptom;
        this.image = image;
        this.video = video;
        this.spectral = spectral;
        this.time = time;
    }
}